package cn.sycoder.mapper;

import cn.sycoder.entity.ProductHistory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.springframework.stereotype.Repository;

import java.util.Date;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author 杨润发
 * @since 2024-11-04
 */
@Repository
public interface ProductHistoryMapper extends BaseMapper<ProductHistory> {

    // 通过月份执行分表存储
    @Insert("insert into ${tableName} (name,inventory_sum,type,create_user,create_time)" +
            "values(#{name},#{inventorySum},#{type},#{userName},#{createTime})")
    void insertInputOrOutputSum(String name,Integer inventorySum, Integer type, String tableName,String userName, Date createTime);
}
